﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace ChatInterfaces
{
    [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IClientReceiverCallback))]
    public interface IServerOperations
    {
        [OperationContract(IsInitiating = true)]
        [FaultContract(typeof(FaultContract))]
        IEnumerable<ClientToPass> Login(string user, string pwd);

        [OperationContract(IsTerminating = true)]
        [FaultContract(typeof(FaultContract))]
        void Logout(string user);
    }

    // CallBack interface in client
    public interface IClientReceiverCallback
    {
        [OperationContract(IsOneWay = true)]
        void NotifyLoginUser(ClientToPass cliente);
        [OperationContract(IsOneWay = true)]
        void NotifyLogoutUser(ClientToPass cliente);
    }

}
